-
Notifications
You must be signed in to change notification settings - Fork 13.4k
deriving should give expn_info #13150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Ensure that all generated code from deriving attributes get an expn_info in their span.
TBH, I have no idea if the call site, name, and span are right. It would be nice to have some more documentation around these things. |
cc @huonw |
Looks fine to me, but I'm not 100% sure about what the fields of expn_info are either; I'll investigate that, report back/submit docs and then (presumably) r+ in a few hours. (Someone else is free to do these steps too.) |
While doing that I poured over the expansion source, and I'm thoroughly confused as to why this specific change (and similar changes I've done in the past) have any effect, specifically: there's this @nick29581 Can you double check that this change has the effect you need for DXR? (Also, derived implementations get the attribute |
@huonw I don't think new_span is called on every single span, see for example I guess I could check automatically_derived (I'm glad it is there), but I do think in general it is nice if all generated code has some expn_info, not just for DXR. |
And I don't know what that travis fail is about, passes that test locally. |
I'd guess the travis failure was just a spurious one (it's passing now).
I think it is, since every item has I could easily be reading the code incorrectly, though. |
(btw, if the travis failure seems spurious, it's possible to restart the job from travis' UI, I did that yday for this PR and then forgot to comment here) |
@huonw looks like you're right, as far as I can tell - at least without this patch, DXR still produces the same output. This was definitely not the case at some point, but DXR tests are much better now, so hopefully this won't regress again. |
Ensure that all generated code from deriving attributes get an expn_info in their span.